package seis635.ui;

import seis635.design.*;
import java.awt.*;
import java.util.TimeZone;
import java.text.DateFormat;
import java.text.SimpleDateFormat;

import javax.swing.*;

public class MainUI{
	private final static DateFormat timerFormat = 
		new SimpleDateFormat(" HH:mm:ss:SSS  ");
	
	private JTabbedPane tabbedPane;
	private StopwatchUI swUI;
	private CountdownUI cdUI;
	private ClockUI clkUI;
	private AlarmUI alrUI;

	public MainUI(Clock c, Stopwatch s, Countdown cd){
		timerFormat.setTimeZone(TimeZone.getTimeZone("GTM+0"));
		JFrame frame = new JFrame("SEIS635 Project");
		frame.setVisible(true);
		frame.setBounds(100, 100, 450, 300);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setSize(400,300);
		frame.setVisible(true);
		
		swUI = new StopwatchUI(s);
		cdUI = new CountdownUI(cd);
		clkUI = new ClockUI();
//		alrUI = new AlarmUI(a);
		
		tabbedPane = new JTabbedPane(JTabbedPane.TOP);
		tabbedPane.addTab("Clock", null, clkUI.getCLKPanel(), null);
//		tabbedPane.addTab("Alarm", null, alrUI.getAlrPanel(), null);
		tabbedPane.addTab("StopWatch", null, swUI.getSWPanel(), null);
		tabbedPane.addTab("Countdown", null, cdUI.getCDPanel(), null);
		
		Container contentPane = frame.getContentPane();
		contentPane.add(tabbedPane, BorderLayout.NORTH);

	}
	public static DateFormat getTimerFormat(){
		return timerFormat;
	}
	public ClockUI getClock(){
		return clkUI;
	}
	public StopwatchUI getStopwatch(){
		return swUI;
	}
	public CountdownUI getCountdown(){
		return cdUI;
	}
	public AlarmUI getAlarm(){
		return alrUI;
	}

}